sections=$3
log="/var/log/mysql/mylog/install.log"
echo "init extends module bxn-score" 
echo "param is $3"
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/user-mysql/${2}/init_mysql_user_score.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_table.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_data.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_portal.sql
mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_bxn.sql
if [ $sections -eq 1 ] || [ $sections -eq 12 ] || [ $sections -eq 13 ] || [ $sections -eq 123 ];then
    echo "has section 1" 
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_data_1.sql
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_portal_1.sql
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_bxn_1.sql
fi
if [ $sections -eq 2 ] || [ $sections -eq 23 ] || [ $sections -eq 123 ] || [ $sections -eq 12 ];then
    echo "has section 2"
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_data_2.sql
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_portal_2.sql
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_bxn_2.sql
fi
if [ $sections -eq 3 ] || [ $sections -eq 13 ] || [ $sections -eq 123 ] || [ $sections -eq 23 ];then
    echo "has section 3"
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_data_3.sql
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_portal_3.sql
        mysql -uroot -p${1} --default-character-set=utf8 < /usr/local/install/init/bxn-score/${2}/init_bxn_3.sql
fi